<?php
namespace app\index\model;

use think\Model;
/**
 * Created by PhpStorm.
 * User: su
 * Date: 2017/12/28
 * Time: 16:07
 */
class Users extends Model
{
    public function getUsers($data)
    {
       $user_info = $this->field('passwored,user_id')->where('uname',$data['uname'])->find();
       if(empty($user_info)){
           return 0;
       }else{
          $user_info =  $user_info->toArray();
           session('user_id',$user_info['user_id']);
           return $user_info;
       }

    }
}